package com.demo.springcloud.service;

import com.demo.springcloud.mapper.StorageMapper;
import com.demo.springcloud.pojo.CommonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author chenyuan
 * @date 2020/12/24 15:10
 */
@Service
@Slf4j
public class StorageServiceImpl implements StorageService {
	@Resource
	private StorageMapper storageMapper;

	// 扣减库存
	@Override
	public int decrease(Long productId, Integer count) {
		log.info("--->>>> storage-service中扣减库存开始 <<<< ");
		int decrease = storageMapper.decrease(productId, count);
		log.info("---<<<< storage-service中扣减库存结束 >>>> ");
		return decrease;
	}
}
